home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-20 | 1.7 KB | 33 lines | [TEXT/RLAB] |
- //-------------------------------------------------------------------//
-
- // Synopsis: Determine suitable AXIS for plot of complex vector.
-
- // Syntax: X = cpltaxes ( Z )
-
- // Description:
-
- // cpltaxes determines a 4-vector X such that
- // plimits(X[1],x[2],x[3].x[4]) sets axes for a plot of Z that
- // has axes of equal length and leaves a reasonable amount of
- // space around the edge of the plot.
-
- // Called by fv(), gersh(), ps() and pscont().
-
- // This file is a translation of cpltaxes.m from version 2.0 of
- // "The Test Matrix Toolbox for Matlab", described in Numerical
- // Analysis Report No. 237, December 1993, by N. J. Higham.
-
- //-------------------------------------------------------------------//
-
- cpltaxes = function ( z )
- {
- // Set x and y axis ranges so both have the same length.
-
- xmin = min(real(z)); xmax = max(real(z));
- ymin = min(imag(z)); ymax = max(imag(z));
-
- // Fix for rare case of `trivial data'.
- if (xmin == xmax)
- {
- xmin = xmin - 1/2;
- xmax = xmax